package com.tywj.panda.driver.details

import com.tywj.panda.customer.common.widget.recyclerview.MyBaseAdapter
import com.tywj.panda.driver.R
import com.tywj.panda.driver.entity.PassengerEntity
import com.tywj.lib.core.widget.recycleview.adapter.BaseViewHolder

class DriverTicketAdapter : MyBaseAdapter<PassengerEntity>(R.layout.driver_check_recyclerview_item) {

    override fun convert(helper: BaseViewHolder, item: PassengerEntity) {
        super.convert(helper, item)

        helper.setText(R.id.tvPhone, item.phone)
        helper.setText(R.id.tvTicketNumber, item.orderNo)


        if (item.inspectFlag == 1)
            helper.setImageResource(R.id.ivChecked, R.drawable.driver_is_not_check)
        else {
            helper.setImageResource(R.id.ivChecked, R.drawable.driver_is_check)
        }

        if (item.arriveFlag == 0)
            helper.setImageResource(R.id.ivArrived, R.drawable.driver_is_not_check)
        else {
            helper.setImageResource(R.id.ivArrived, R.drawable.driver_is_check)
        }
    }
}